{include file='public/header' /}
<div class="layuimini-container">
    <form id="modelUserForm" lay-filter="modelUserForm" class="layui-form model-form">
        <input name="id" type="hidden" value="{$row.id}"/>
        <div class="layui-form-item">
            <label class="layui-form-label layui-form-required">商家名称：</label>
            <div class="layui-input-block">
                <input name="name" readonly value="{$row.name}" placeholder="请输入商家名称,最多50个字"type="text" class="layui-input" maxlength="50"
                       lay-verType="tips" lay-verify="required" required/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label layui-form-required">商家地址：</label>
            <div class="layui-input-block">
                <input name="address" readonly placeholder="请输入商家地址，最多100个字" type="text" value="{$row.address}" class="layui-input" maxlength="100"
                       lay-verType="tips" lay-verify="required" required/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label layui-form-required">商家电话：</label>
            <div class="layui-input-block">
                <input name="phone" readonly maxlength="20" placeholder="请输入商家电话，最多20个数字" type="text" value="{$row.phone}" class="layui-input"
                       lay-verType="tips" lay-verify="required" required/>

            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label layui-form-required">门头照片：</label>
            <div class="layui-input-block">
                <img src="{$row.StoreData.shop_image}" style="width: 100px;height:100px" class="img" >

            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label layui-form-required">卫生许可照片：</label>
            <div class="layui-input-block">
                <img src="{$row.StoreData.health_image}" style="width: 100px;height:100px" class="img" >

            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label layui-form-required">营业执照：</label>
            <div class="layui-input-block">
                <img src="{$row.StoreData.business_image}" style="width: 100px;height:100px" class="img" >

            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label layui-form-required">营业许可照：</label>
            <div class="layui-input-block">
                <img src="{$row.StoreData.business_permission}" style="width: 100px;height:100px" class="img" >

            </div>
        </div>
        <div class="layui-form-item" >
            <label class="layui-form-label">审核：</label>
            <div class="layui-input-block">
                <input type="radio"  name="status" value="1" title="通过" {if isset($row.status)&&$row.status== 1}checked{/if}>
                <input type="radio"  name="status" value="3" title="驳回" {if isset($row.status)&&$row.status== 3}checked{/if}>

            </div>
        </div>
        <div class="layui-form-item" style="margin-bottom: 150px">
            <label class="layui-form-label">备注：</label>
            <div class="layui-input-block">
                <textarea  placeholder="请输入备注" name="comment" class="layui-textarea">{$row['comment']}</textarea>
            </div>
        </div>
        <div class="form-group-bottom text-center" style="position: fixed; margin-top:50px;bottom: 0px;width:100%;height:50px">
            <button class="layui-btn layui-btn-primary" type="button" onclick="close_window()" ew-event="closePageDialog">取消</button>
            <button class="layui-btn" lay-filter="modelSubmitUser" lay-submit>保存</button>
        </div>
    </form>
</div>
{include file='public/footer' /}
<script>


    layui.use(['layer', 'form', 'table', 'util', 'admin'], function () {
        var $ = layui.jquery;
        var layer = layui.layer;
        var form = layui.form;
        var table = layui.table;
        var util = layui.util;
        var admin = layui.admin;

        $(function(){
            var img_show = null; // tips提示
            $('img').hover(function(){
                var kd=$(this).width();
                kd1=kd*4;          //图片放大倍数
                kd2=kd*4+30;       //图片放大倍数
                var img = "<img class='img_msg' src='"+$(this).attr('src')+"' style='width:"+kd1+"px;' />";
                img_show = layer.tips(img, this,{
                    tips:[2, 'rgba(41,41,41,.5)']
                    ,area: [kd2+'px']
                });
            },function(){
                layer.close(img_show);
            });
        })

        var url = '{:__url("mall.store/check")}';

        // 表单提交事件
        form.on('submit(modelSubmitUser)', function (data) {
            layer.load(2);
            $.post(url, data.field, function (res) {

                layer.closeAll('loading');
                if (res.code == 1) {
                    layer.msg(res.msg, {icon: 1,time: 1000},function(index){
                        window.parent.location.reload();
                    });
                } else {
                    layer.msg(res.msg, {icon: 2});
                }
            }, 'json');
            return false;
        });
    });
    function close_window(){
        window.parent.location.reload();
    }
</script>